@section('title')
<?php echo $post->title; ?> @parent
@show

@section('content')
<div class="navbar theme-white">
    <div class="navbar-inner">
        <div class="left"><a href="{{ route('group.index', $sns_group->id) }}" class="back link icon-only "> <i class="icon icon-back"></i></a></div>
        <div class="center sliding">{{ $sns_group->group_name }}</div>
				@if($is_member)
        <div class="right">
            <a href="#{{ route('ask.comment', $post->id) }}" class="link icon-only comment-popup"> <i class="icon icon-write"></i></a>
        </div>
				@endif
    </div>
</div>

<div class="pages navbar-through toolbar-fixed">
    <div data-page="ask-item-<?php echo $post->id; ?>" class="page page-on-center pb60">
        <div class="page-content">
			<div class="post-top">
				<div class="item-collect" id="post-{{ $post->id }}"><span class="collect-status">@if($is_collected)已收藏@else收藏 @endif</span> (<span class="collect-badge"><?php echo $post->postExtra->collects_count; ?></span>)</div>
			</div>
			<div class="post-box">
				<div class="content-block-title post-title"><?php echo $post->title; ?></div>
				<div class="content-block post-info">
						<div class="post-creator-container">
								<div class="avatar-box">
									<a href="{{ route('user.index', $post->creator_id) }}">
									<img class="avatar" src="@if($post->creatorAvatar()){{ Config::get('app.url').'/'.$post->creatorAvatar() }}@else /img/1.png @endif">
									</a>
								</div>
								<div class="detail">
									<p class="nickname"><?php echo $post->creatorName(); ?></p>
									<p class="post-date"><?php echo $post->created_at; ?></p>
								</div>
						</div>
				</div>
				<div class="content-block inset post-content">
						<p><?php echo nl2br($post->content); ?></p>
				</div>
				<div class="item-bottom">
						<div class="item-after item-like" id="post-{{ $post->id }}"><span class="like-badge"><?php echo $post->postExtra->likes_count; ?></span></div>
				</div>
			</div>
			<div class="content-block-title comment-title">全部回复</div>
            <ul class="comments">
                <?php foreach($post->comments as $comment): ?>
                    <li class="comments-box">
												<div class="item-inner">
													 <div class="post-creator-container">
															<div class="avatar-box">
																<a href="{{ route('user.index', $comment->creator_id) }}" class="item-link">
																<img class="avatar" src="@if($comment->creatorAvatar()){{ Config::get('app.url').'/'.$comment->creatorAvatar() }}@else /img/1.png @endif">
																</a>
															</div>
															<div class="detail">
																<p class="nickname"><?php echo $comment->creatorName(); ?></span>
																<p class="post-date"><?php echo $comment->created_at; ?></p>
															</div>
													</div>
														<div class="item-title comment-content"><?php echo nl2br($comment->content); ?></div>
														<div class="item-bottom">
																<div class="item-after item-like" id="comment-{{ $comment->id }}"><span class="like-badge"><?php echo $comment->commentExtra->likes_count; ?></span></div>
														</div>
												</div>
                    </li>
                <?php endforeach; ?>
            </ul>
        </div>
		@include('widgets.toolbar', array('active'=>'sns'))
    </div>
</div>
@stop